/**
 * Copyright 2008 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package kiff.security;

/**
 * Access Control List Entry interface.
 * @author Adam
 * @version $Id: AclEntry.java 38 2008-09-21 07:40:51Z a.ruggles $
 */
public interface AclEntry {
	/**
	 * Returns the access control list for the entry.
	 * @return the access control list for the entry.
	 */
	Acl getAcl();

	/**
	 * Returns the permission for the access control list entry.
	 * @return The permission for the access control list entry.
	 */
	Permission getPermission();

	/**
	 * Returns the principal for the access control list entry.
	 * @return The principal for the access control list entry.
	 */
	Principal getPrincipal();

	/**
	 * Returns whether or not the access control list entry has the specified permission.
	 * @param permission The permission to review.
	 * @return <code>true</code> if the access control list has the specified permission, otherwise <code>false</code>.
	 */
	boolean hasPermission(Permission permission);

	/**
	 * Sets the acl for the entry.
	 * @param acl the acl for the entry.
	 */
	void setAcl(Acl acl);

	/**
	 * Sets the permission for the access control list entry.
	 * @param permission The permission to be associated with the access control list entry.
	 */
	void setPermission(Permission permission);

	/**
	 * Sets the role for the access control list entry.
	 * @param principal the role to be associated with the access control list entry.
	 */
	void setPrincipal(Principal principal);
}
